<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>
<body>
    <div id="div">


    </div>

</body>
<script>
    //先生子，再挂子，最后用子

   //创建局部的入口组件
   var tem = {
       data:function () {
           return {
               msg:"我是入口组件"
           }
       },
       template:"<div>{{msg}}</div>"

   };
   //实例化vue对象
   var app = new Vue({
       el:"#div",
       data:function () {
           return {}
       },
       //挂载子组件
       components:{
           tem:tem
       },
       //父组件直接使用
       template:"<tem></tem>"
   });
</script>
</html>